package com.vn.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Customer")
public class Customer {
	
	public Customer(){}
	
	public Customer(String id, String name, short gender, Date birthday,
			String birthPlace, String origin, String placeIssueIDCard,
			Date dateIssueIDCard, String address, String phoneNumber,
			String email, Storage storage) {
		super();
		this.id = id;
		this.name = name;
		this.gender = gender;
		this.birthday = birthday;
		this.birthPlace = birthPlace;
		this.origin = origin;
		this.placeIssueIDCard = placeIssueIDCard;
		this.dateIssueIDCard = dateIssueIDCard;
		this.address = address;
		this.phoneNumber = phoneNumber;
		this.email = email;
		this.storage = storage;
	}

	@Column(name="Name_Cus")
	private String name;
	
	@Column(name="Gender_Cus")
	private short gender;
	
	@Column(name="Birthday_Cus")
	private Date birthday;
	
	@Column(name="BirthPlace_Cus")
	private String birthPlace;
	
	@Column(name="Origin_Cus")
	private String origin;
	
	@Id
	@Column(name="IdentityCardNo_Cus")
	private String id;
	
	@Column(name="PlaceIssueIDCard_Cus")
	private String placeIssueIDCard;
	
	@Column(name="DateIssueIDCard_Cus")
	private Date dateIssueIDCard;
	
	@Column(name="Address_Cus")
	private String address;
	
	@Column(name="PhoneNumber_Cus")
	private String phoneNumber;
	
	@Column(name="Email_Cus")
	private String email;
	
	@JoinColumn(name="FolderName",referencedColumnName="FolderName")
	@ManyToOne
	private Storage storage;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public short getGender() {
		return gender;
	}

	public void setGender(short gender) {
		this.gender = gender;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getBirthPlace() {
		return birthPlace;
	}

	public void setBirthPlace(String birthPlace) {
		this.birthPlace = birthPlace;
	}

	public String getOrigin() {
		return origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPlaceIssueIDCard() {
		return placeIssueIDCard;
	}

	public void setPlaceIssueIDCard(String placeIssueIDCard) {
		this.placeIssueIDCard = placeIssueIDCard;
	}

	public Date getDateIssueIDCard() {
		return dateIssueIDCard;
	}

	public void setDateIssueIDCard(Date dateIssueIDCard) {
		this.dateIssueIDCard = dateIssueIDCard;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Storage getStorage() {
		return storage;
	}

	public void setStorage(Storage storage) {
		this.storage = storage;
	}

	@OneToMany
	private List<PurchaseContract> purchaseContracts;

	public List<PurchaseContract> getPurchaseContracts() {
		return purchaseContracts;
	}

	public void setPurchaseContracts(List<PurchaseContract> purchaseContracts) {
		this.purchaseContracts = purchaseContracts;
	}
	
	
}
